#version 330 core

in vec2 TexCoords;

uniform float Time;
uniform vec2 MousePos;
uniform vec2 Size;
uniform sampler2D image;
uniform sampler2D imageNoise;
uniform sampler2D imageNoise2;
uniform float DrawBg;
uniform sampler2D Color;

out vec4 FragColor;

void main()
{
	float size_dot = 24.0;
	vec2 ratio = vec2(1.0, Size.x / Size.y);
	vec2 pixelated_uv = floor(TexCoords * size_dot * ratio) / (size_dot * ratio);
	float dots = length(fract(TexCoords * size_dot * ratio) - vec2(0.5)) * 2.0;
	dots = (1.0 - dots) * 10.0;
	dots = clamp(dots, 0.0, 1.0);
	
	vec4 img_color = texture2D(image, pixelated_uv-Time*0.01);
	
	FragColor = mix(vec4(dots), img_color, dots);
	
}
